Use PrecompileTools to precompile Acquisition.jl#13
Conversation
We precompile common signal formats, such as ComplexF32, ComplexF64, Int16, Float32 to reduce time to first acquisition
zsoerenm
left a comment
There was a problem hiding this comment.
Thanks for looking into this!
I have some comments, but otherwise looks good.
I haven't tested the code below. Could you test that? ;)
| data_i8 = rand(Int8,Int(round(rate*0.01))) | ||
| data_i16 = rand(Int16,Int(round(rate*0.01))) | ||
| data_f32 = rand(Float32,Int(round(rate*0.01))) | ||
| data_f64 = rand(Float64,Int(round(rate*0.01))) |
There was a problem hiding this comment.
I've actually never tested acquisition with real valued data. Does that actually work?
If yes, I think we should add automatic test first. Otherwise just remove those.
There was a problem hiding this comment.
I've seen it work with Int8 and Int16 IF data from NordNav frontend, CYGNSS and TDS-1 missions.
It need to be at an intermediate frequency of course, you can't have real-valued baseband / zero-IF signal
The downconvert! function will promote any non-ComplexF32 data into ComplexF32 though
Will add the tests
|
|
||
|
|
||
| #common complex data | ||
| data_ci8 = rand(Complex{Int8},Int(round(rate*0.01))) |
There was a problem hiding this comment.
Here the same as in my previous comment. There isn't an automatic test for Int8. So either remove that or add an automatic test?
| data_ci16 = rand(Complex{Int16},Int(round(rate*0.01))) | ||
| data_cf32 = rand(Complex{Float32},Int(round(rate*0.01))) | ||
| data_cf64 = rand(Complex{Float64},Int(round(rate*0.01))) |
There was a problem hiding this comment.
I think it is fine if we just hard code the number of samples to something like a 1000:
| data_ci16 = rand(Complex{Int16},Int(round(rate*0.01))) | |
| data_cf32 = rand(Complex{Float32},Int(round(rate*0.01))) | |
| data_cf64 = rand(Complex{Float64},Int(round(rate*0.01))) | |
| signal_types = (Int16, Float32, Float64) | |
| signals = map(T -> rand(Complex{T}, 1000), signal_types) |
We probably also need different sample_rates types, interm_freq types and max_doppler types
samplerates = (10000Hz, 10000.0Hz, 1000u"kHz", 1000.0u"kHz", 10u"MHz", 10.0u"MHz")
interm_freqs = (100Hz, 100.0Hz, 100u"kHz", 100.0u"kHz", 1u"MHz", 1.0u"MHz")
max_dopplers = (1000Hz, 1000.0Hz, 1u"kHz", 1.0u"kHz")
The GPSL1 should be initialized before @compile_workload because it isn't part of Acquisition.jl .
systems = (GPSL1(), GPSL5(), GalileoE1B())
| samplerate = rate*Hz | ||
| acquire(GPSL1(),data_ci8[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||
| acquire(GPSL1(),data_ci16[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||
| acquire(GPSL1(),data_cf32[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||
| acquire(GPSL1(),data_cf64[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | ||
| acquire(GPSL1(),data_i8[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | ||
| acquire(GPSL1(),data_i16[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | ||
| acquire(GPSL1(),data_f32[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | ||
| acquire(GPSL1(),data_f64[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); |
There was a problem hiding this comment.
| samplerate = rate*Hz | |
| acquire(GPSL1(),data_ci8[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | |
| acquire(GPSL1(),data_ci16[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | |
| acquire(GPSL1(),data_cf32[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | |
| acquire(GPSL1(),data_cf64[1:2048], samplerate, 1:32; interm_freq=0*Hz, max_doppler=10e3*Hz); | |
| acquire(GPSL1(),data_i8[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | |
| acquire(GPSL1(),data_i16[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | |
| acquire(GPSL1(),data_f32[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | |
| acquire(GPSL1(),data_f64[1:2048], samplerate, 1:32; interm_freq=10*Hz, max_doppler=10e3*Hz); | |
| foreach(systems) do system | |
| foreach(signals) do signal | |
| foreach(samplerates) do samplerate | |
| foreach(interm_freqs) do interm_freq | |
| foreach(max_dopplers) do max_doppler | |
| acquire(system, signal, samplerate, 1:1; interm_freq, max_doppler) | |
| end | |
| end | |
| end | |
| end | |
| end |
(It is enough to acquire a single satellite)
I haven't tested the code, though ;)
You can delete the comments, IMHO
We precompile common signal formats, such as ComplexF32, ComplexF64, Int16, Float32 to reduce time to first acquisition